home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Technology Seed / Jan. '98 ATS.toast / QuickTime™ 3.0b11 / QTPublicInterfaces / CIncludes / CMApplication.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-12  |  37.0 KB  |  1,132 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CMApplication.h
  3.  
  4.      Contains:    Color Matching Interfaces
  5.  
  6.      Version:    Technology:    ColorSync 2.1
  7.                  Release:    QuickTime 3.0 Beta
  8.  
  9.      Copyright:    © 1992, 1994-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __CMAPPLICATION__
  19. #define __CMAPPLICATION__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __QUICKDRAW__
  25. #include <Quickdraw.h>
  26. #endif
  27. #ifndef __FILES__
  28. #include <Files.h>
  29. #endif
  30. #ifndef __PRINTING__
  31. #include <Printing.h>
  32. #endif
  33. #ifndef __CMICCPROFILE__
  34. #include <CMICCProfile.h>
  35. #endif
  36.  
  37.  
  38.  
  39. #if PRAGMA_ONCE
  40. #pragma once
  41. #endif
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46.  
  47. #if PRAGMA_IMPORT
  48. #pragma import on
  49. #endif
  50.  
  51. #if PRAGMA_STRUCT_ALIGN
  52.     #pragma options align=mac68k
  53. #elif PRAGMA_STRUCT_PACKPUSH
  54.     #pragma pack(push, 2)
  55. #elif PRAGMA_STRUCT_PACK
  56.     #pragma pack(2)
  57. #endif
  58.  
  59.  
  60. enum {
  61.     kDefaultCMMSignature        = FOUR_CHAR_CODE('appl')
  62. };
  63.  
  64. /* Macintosh 68K trap word */
  65.  
  66. enum {
  67.     cmTrap                        = 0xABEE
  68. };
  69.  
  70.  
  71. /* PicComment IDs */
  72.  
  73. enum {
  74.     cmBeginProfile                = 220,
  75.     cmEndProfile                = 221,
  76.     cmEnableMatching            = 222,
  77.     cmDisableMatching            = 223,
  78.     cmComment                    = 224
  79. };
  80.  
  81. /* PicComment selectors for cmComment */
  82.  
  83. enum {
  84.     cmBeginProfileSel            = 0,
  85.     cmContinueProfileSel        = 1,
  86.     cmEndProfileSel                = 2,
  87.     cmProfileIdentifierSel        = 3
  88. };
  89.  
  90.  
  91. /* Defines for version 1.0 CMProfileSearchRecord.fieldMask */
  92.  
  93. enum {
  94.     cmMatchCMMType                = 0x00000001,
  95.     cmMatchApplProfileVersion    = 0x00000002,
  96.     cmMatchDataType                = 0x00000004,
  97.     cmMatchDeviceType            = 0x00000008,
  98.     cmMatchDeviceManufacturer    = 0x00000010,
  99.     cmMatchDeviceModel            = 0x00000020,
  100.     cmMatchDeviceAttributes        = 0x00000040,
  101.     cmMatchFlags                = 0x00000080,
  102.     cmMatchOptions                = 0x00000100,
  103.     cmMatchWhite                = 0x00000200,
  104.     cmMatchBlack                = 0x00000400
  105. };
  106.  
  107. /* Defines for version 2.0 CMSearchRecord.searchMask */
  108.  
  109. enum {
  110.     cmMatchAnyProfile            = 0x00000000,
  111.     cmMatchProfileCMMType        = 0x00000001,
  112.     cmMatchProfileClass            = 0x00000002,
  113.     cmMatchDataColorSpace        = 0x00000004,
  114.     cmMatchProfileConnectionSpace = 0x00000008,
  115.     cmMatchManufacturer            = 0x00000010,
  116.     cmMatchModel                = 0x00000020,
  117.     cmMatchAttributes            = 0x00000040,
  118.     cmMatchProfileFlags            = 0x00000080
  119. };
  120.  
  121. /* Result codes */
  122.  
  123. enum {
  124.                                                                 /* General Errors */
  125.     cmProfileError                = -170,
  126.     cmMethodError                = -171,
  127.     cmMethodNotFound            = -175,                            /* CMM not present */
  128.     cmProfileNotFound            = -176,                            /* Responder error */
  129.     cmProfilesIdentical            = -177,                            /* Profiles the same */
  130.     cmCantConcatenateError        = -178,                            /* Profile can't be concatenated */
  131.     cmCantXYZ                    = -179,                            /* CMM cant handle XYZ space */
  132.     cmCantDeleteProfile            = -180,                            /* Responder error */
  133.     cmUnsupportedDataType        = -181,                            /* Responder error */
  134.     cmNoCurrentProfile            = -182,                            /* Responder error */
  135.                                                                 /* Profile Access Errors */
  136.     cmElementTagNotFound        = -4200,
  137.     cmIndexRangeErr                = -4201,                        /* Tag index out of range */
  138.     cmCantDeleteElement            = -4202,
  139.     cmFatalProfileErr            = -4203,
  140.     cmInvalidProfile            = -4204,                        /* A Profile must contain a 'cs1 ' tag to be valid */
  141.     cmInvalidProfileLocation    = -4205,                        /* Operation not supported for this profile location */
  142.     cmCantCopyModifiedV1Profile    = -4215,                        /* Illegal to copy version 1 profiles that have been modified */
  143.                                                                 /* Profile Search Errors */
  144.     cmInvalidSearch                = -4206,                        /* Bad Search Handle */
  145.     cmSearchError                = -4207,
  146.     cmErrIncompatibleProfile    = -4208,                        /* Other ColorSync Errors */
  147.     cmInvalidColorSpace            = -4209,                        /* Profile colorspace does not match bitmap type */
  148.     cmInvalidSrcMap                = -4210,                        /* Source pix/bit map was invalid */
  149.     cmInvalidDstMap                = -4211,                        /* Destination pix/bit map was invalid */
  150.     cmNoGDevicesError            = -4212,                        /* Begin/End Matching -- no gdevices available */
  151.     cmInvalidProfileComment        = -4213,                        /* Bad Profile comment during drawpicture */
  152.     cmRangeOverFlow                = -4214,                        /* Color conversion warning that some output color values over/underflowed and were clipped */
  153.     cmNamedColorNotFound        = -4216,                        /* NamedColor not found */
  154.     cmCantGamutCheckError        = -4217                            /* Gammut checking not supported by this ColorWorld */
  155. };
  156.  
  157. /* deviceType values for ColorSync 1.0 Device Profile access */
  158.  
  159. enum {
  160.     cmSystemDevice                = FOUR_CHAR_CODE('sys '),
  161.     cmGDevice                    = FOUR_CHAR_CODE('gdev')
  162. };
  163.  
  164. /* Commands for CMFlattenUPP(…) */
  165.  
  166. enum {
  167.     cmOpenReadSpool                = 1,
  168.     cmOpenWriteSpool            = 2,
  169.     cmReadSpool                    = 3,
  170.     cmWriteSpool                = 4,
  171.     cmCloseSpool                = 5
  172. };
  173.  
  174. /* Flags for PostScript-related functions */
  175.  
  176. enum {
  177.     cmPS7bit                    = 1,
  178.     cmPS8bit                    = 2
  179. };
  180.  
  181. /* Flags for profile embedding functions */
  182.  
  183. enum {
  184.     cmEmbedWholeProfile            = 0x00000000,
  185.     cmEmbedProfileIdentifier    = 0x00000001
  186. };
  187.  
  188. /* Commands for CMAccessUPP(…) */
  189.  
  190. enum {
  191.     cmOpenReadAccess            = 1,
  192.     cmOpenWriteAccess            = 2,
  193.     cmReadAccess                = 3,
  194.     cmWriteAccess                = 4,
  195.     cmCloseAccess                = 5,
  196.     cmCreateNewAccess            = 6,
  197.     cmAbortWriteAccess            = 7,
  198.     cmBeginAccess                = 8,
  199.     cmEndAccess                    = 9
  200. };
  201.  
  202.  
  203. /* Abstract data type for memory-based Profile */
  204. typedef struct OpaqueCMProfileRef*         CMProfileRef;
  205. /* Abstract data type for Profile search result */
  206. typedef struct OpaqueCMProfileSearchRef*  CMProfileSearchRef;
  207. /* Abstract data type for BeginMatching(…) reference */
  208. typedef struct OpaqueCMMatchRef*         CMMatchRef;
  209. /* Abstract data type for ColorWorld reference */
  210. typedef struct OpaqueCMWorldRef*         CMWorldRef;
  211. /* Caller-supplied flatten function */
  212. typedef CALLBACK_API( OSErr , CMFlattenProcPtr )(long command, long *size, void *data, void *refCon);
  213. /* Caller-supplied progress function for Bitmap & PixMap matching routines */
  214. typedef CALLBACK_API( Boolean , CMBitmapCallBackProcPtr )(long progress, void *refCon);
  215. /* Caller-supplied filter function for Profile search */
  216. typedef CALLBACK_API( Boolean , CMProfileFilterProcPtr )(CMProfileRef prof, void *refCon);
  217. /* Caller-supplied function for profile access */
  218. typedef CALLBACK_API( OSErr , CMProfileAccessProcPtr )(long command, long offset, long *size, void *data, void *refCon);
  219. typedef STACK_UPP_TYPE(CMFlattenProcPtr)                         CMFlattenUPP;
  220. typedef STACK_UPP_TYPE(CMBitmapCallBackProcPtr)                 CMBitmapCallBackUPP;
  221. typedef STACK_UPP_TYPE(CMProfileFilterProcPtr)                     CMProfileFilterUPP;
  222. typedef STACK_UPP_TYPE(CMProfileAccessProcPtr)                     CMProfileAccessUPP;
  223. enum { uppCMFlattenProcInfo = 0x00003FE0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  224. enum { uppCMBitmapCallBackProcInfo = 0x000003D0 };                 /* pascal 1_byte Func(4_bytes, 4_bytes) */
  225. enum { uppCMProfileFilterProcInfo = 0x000003D0 };                 /* pascal 1_byte Func(4_bytes, 4_bytes) */
  226. enum { uppCMProfileAccessProcInfo = 0x0000FFE0 };                 /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  227. #define NewCMFlattenProc(userRoutine)                             (CMFlattenUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMFlattenProcInfo, GetCurrentArchitecture())
  228. #define NewCMBitmapCallBackProc(userRoutine)                     (CMBitmapCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMBitmapCallBackProcInfo, GetCurrentArchitecture())
  229. #define NewCMProfileFilterProc(userRoutine)                     (CMProfileFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileFilterProcInfo, GetCurrentArchitecture())
  230. #define NewCMProfileAccessProc(userRoutine)                     (CMProfileAccessUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileAccessProcInfo, GetCurrentArchitecture())
  231. #define CallCMFlattenProc(userRoutine, command, size, data, refCon)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppCMFlattenProcInfo, (command), (size), (data), (refCon))
  232. #define CallCMBitmapCallBackProc(userRoutine, progress, refCon)  CALL_TWO_PARAMETER_UPP((userRoutine), uppCMBitmapCallBackProcInfo, (progress), (refCon))
  233. #define CallCMProfileFilterProc(userRoutine, prof, refCon)         CALL_TWO_PARAMETER_UPP((userRoutine), uppCMProfileFilterProcInfo, (prof), (refCon))
  234. #define CallCMProfileAccessProc(userRoutine, command, offset, size, data, refCon)  CALL_FIVE_PARAMETER_UPP((userRoutine), uppCMProfileAccessProcInfo, (command), (offset), (size), (data), (refCon))
  235. typedef long                             CMError;
  236. /* For 1.0 and 2.0 profile header variants */
  237. /* CMAppleProfileHeader */
  238.  
  239. union CMAppleProfileHeader {
  240.     CMHeader                         cm1;
  241.     CM2Header                         cm2;
  242. };
  243. typedef union CMAppleProfileHeader        CMAppleProfileHeader;
  244. /* Param for CWConcatColorWorld(…) */
  245.  
  246. struct CMConcatProfileSet {
  247.     unsigned short                     keyIndex;                    /* Zero-based */
  248.     unsigned short                     count;                        /* Min 1 */
  249.     CMProfileRef                     profileSet[1];                /* Variable. Ordered from Source -> Dest */
  250. };
  251. typedef struct CMConcatProfileSet        CMConcatProfileSet;
  252. /* ColorSync color data types */
  253.  
  254. struct CMRGBColor {
  255.     unsigned short                     red;                        /* 0..65535 */
  256.     unsigned short                     green;
  257.     unsigned short                     blue;
  258. };
  259. typedef struct CMRGBColor                CMRGBColor;
  260.  
  261. struct CMCMYKColor {
  262.     unsigned short                     cyan;                        /* 0..65535 */
  263.     unsigned short                     magenta;
  264.     unsigned short                     yellow;
  265.     unsigned short                     black;
  266. };
  267. typedef struct CMCMYKColor                CMCMYKColor;
  268.  
  269. struct CMCMYColor {
  270.     unsigned short                     cyan;                        /* 0..65535 */
  271.     unsigned short                     magenta;
  272.     unsigned short                     yellow;
  273. };
  274. typedef struct CMCMYColor                CMCMYColor;
  275.  
  276. struct CMHLSColor {
  277.     unsigned short                     hue;                        /* 0..65535. Fraction of circle. Red at 0 */
  278.     unsigned short                     lightness;                    /* 0..65535 */
  279.     unsigned short                     saturation;                    /* 0..65535 */
  280. };
  281. typedef struct CMHLSColor                CMHLSColor;
  282.  
  283. struct CMHSVColor {
  284.     unsigned short                     hue;                        /* 0..65535. Fraction of circle. Red at 0 */
  285.     unsigned short                     saturation;                    /* 0..65535 */
  286.     unsigned short                     value;                        /* 0..65535 */
  287. };
  288. typedef struct CMHSVColor                CMHSVColor;
  289.  
  290. struct CMLabColor {
  291.     unsigned short                     L;                            /* 0..65535 maps to 0..100 */
  292.     unsigned short                     a;                            /* 0..65535 maps to -128..127.996 */
  293.     unsigned short                     b;                            /* 0..65535 maps to -128..127.996 */
  294. };
  295. typedef struct CMLabColor                CMLabColor;
  296.  
  297. struct CMLuvColor {
  298.     unsigned short                     L;                            /* 0..65535 maps to 0..100 */
  299.     unsigned short                     u;                            /* 0..65535 maps to -128..127.996 */
  300.     unsigned short                     v;                            /* 0..65535 maps to -128..127.996 */
  301. };
  302. typedef struct CMLuvColor                CMLuvColor;
  303.  
  304. struct CMYxyColor {
  305.     unsigned short                     capY;                        /* 0..65535 maps to 0..1 */
  306.     unsigned short                     x;                            /* 0..65535 maps to 0..1 */
  307.     unsigned short                     y;                            /* 0..65535 maps to 0..1 */
  308. };
  309. typedef struct CMYxyColor                CMYxyColor;
  310.  
  311. struct CMGrayColor {
  312.     unsigned short                     gray;                        /* 0..65535 */
  313. };
  314. typedef struct CMGrayColor                CMGrayColor;
  315.  
  316. struct CMMultichannel5Color {
  317.     unsigned char                     components[5];                /* 0..255 */
  318. };
  319. typedef struct CMMultichannel5Color        CMMultichannel5Color;
  320.  
  321. struct CMMultichannel6Color {
  322.     unsigned char                     components[6];                /* 0..255 */
  323. };
  324. typedef struct CMMultichannel6Color        CMMultichannel6Color;
  325.  
  326. struct CMMultichannel7Color {
  327.     unsigned char                     components[7];                /* 0..255 */
  328. };
  329. typedef struct CMMultichannel7Color        CMMultichannel7Color;
  330.  
  331. struct CMMultichannel8Color {
  332.     unsigned char                     components[8];                /* 0..255 */
  333. };
  334. typedef struct CMMultichannel8Color        CMMultichannel8Color;
  335.  
  336. struct CMNamedColor {
  337.     unsigned long                     namedColorIndex;            /* 0..a lot */
  338. };
  339. typedef struct CMNamedColor                CMNamedColor;
  340.  
  341. union CMColor {
  342.     CMRGBColor                         rgb;
  343.     CMHSVColor                         hsv;
  344.     CMHLSColor                         hls;
  345.     CMXYZColor                         XYZ;
  346.     CMLabColor                         Lab;
  347.     CMLuvColor                         Luv;
  348.     CMYxyColor                         Yxy;
  349.     CMCMYKColor                     cmyk;
  350.     CMCMYColor                         cmy;
  351.     CMGrayColor                     gray;
  352.     CMMultichannel5Color             mc5;
  353.     CMMultichannel6Color             mc6;
  354.     CMMultichannel7Color             mc7;
  355.     CMMultichannel8Color             mc8;
  356.     CMNamedColor                     namedColor;
  357. };
  358. typedef union CMColor                    CMColor;
  359.  
  360. struct CMProfileSearchRecord {
  361.     CMHeader                         header;
  362.     unsigned long                     fieldMask;
  363.     unsigned long                     reserved[2];
  364. };
  365. typedef struct CMProfileSearchRecord    CMProfileSearchRecord;
  366. typedef CMProfileSearchRecord *            CMProfileSearchRecordPtr;
  367. typedef CMProfileSearchRecordPtr *        CMProfileSearchRecordHandle;
  368. /* Search definition for 2.0 */
  369.  
  370. struct CMSearchRecord {
  371.     OSType                             CMMType;
  372.     OSType                             profileClass;
  373.     OSType                             dataColorSpace;
  374.     OSType                             profileConnectionSpace;
  375.     unsigned long                     deviceManufacturer;
  376.     unsigned long                     deviceModel;
  377.     unsigned long                     deviceAttributes[2];
  378.     unsigned long                     profileFlags;
  379.     unsigned long                     searchMask;
  380.     CMProfileFilterUPP                 filter;
  381. };
  382. typedef struct CMSearchRecord            CMSearchRecord;
  383. /* GetCWInfo structures */
  384.  
  385. struct CMMInfoRecord {
  386.     OSType                             CMMType;
  387.     long                             CMMVersion;
  388. };
  389. typedef struct CMMInfoRecord            CMMInfoRecord;
  390.  
  391. struct CMCWInfoRecord {
  392.     unsigned long                     cmmCount;
  393.     CMMInfoRecord                     cmmInfo[2];
  394. };
  395. typedef struct CMCWInfoRecord            CMCWInfoRecord;
  396. /* profile identifier structures */
  397.  
  398. struct CMProfileIdentifier {
  399.     CM2Header                         profileHeader;
  400.     CMDateTime                         calibrationDate;
  401.     unsigned long                     ASCIIProfileDescriptionLen;
  402.     char                             ASCIIProfileDescription[1];    /* variable length */
  403. };
  404. typedef struct CMProfileIdentifier        CMProfileIdentifier;
  405. typedef CMProfileIdentifier *            CMProfileIdentifierPtr;
  406. /* packing formats */
  407.  
  408. enum {
  409.     cmNoColorPacking            = 0x0000,
  410.     cmAlphaSpace                = 0x0080,
  411.     cmWord5ColorPacking            = 0x0500,
  412.     cmLong8ColorPacking            = 0x0800,
  413.     cmLong10ColorPacking        = 0x0A00,
  414.     cmAlphaFirstPacking            = 0x1000,
  415.     cmOneBitDirectPacking        = 0x0B00,
  416.     cmAlphaLastPacking            = 0x0000,
  417.     cm24_8ColorPacking            = 0x2100,
  418.     cm32_8ColorPacking            = cmLong8ColorPacking,
  419.     cm40_8ColorPacking            = 0x2200,
  420.     cm48_8ColorPacking            = 0x2300,
  421.     cm56_8ColorPacking            = 0x2400,
  422.     cm64_8ColorPacking            = 0x2500,
  423.     cm32_16ColorPacking            = 0x2600,
  424.     cm32_32ColorPacking            = 0x2700
  425. };
  426.  
  427. /* general colorspaces */
  428.  
  429. enum {
  430.     cmNoSpace                    = 0,
  431.     cmRGBSpace                    = 1,
  432.     cmCMYKSpace                    = 2,
  433.     cmHSVSpace                    = 3,
  434.     cmHLSSpace                    = 4,
  435.     cmYXYSpace                    = 5,
  436.     cmXYZSpace                    = 6,
  437.     cmLUVSpace                    = 7,
  438.     cmLABSpace                    = 8,
  439.     cmReservedSpace1            = 9,
  440.     cmGraySpace                    = 10,
  441.     cmReservedSpace2            = 11,
  442.     cmGamutResultSpace            = 12,
  443.     cmNamedIndexedSpace            = 16,
  444.     cmMCFiveSpace                = 17,
  445.     cmMCSixSpace                = 18,
  446.     cmMCSevenSpace                = 19,
  447.     cmMCEightSpace                = 20
  448. };
  449.  
  450. /* supported CMBitmapColorSpaces - each of the following is a */
  451. /* combination of a general colospace and a packing formats */
  452.  
  453. enum {
  454.     cmRGBASpace                    = cmRGBSpace + cmAlphaSpace,
  455.     cmGrayASpace                = cmGraySpace + cmAlphaSpace,
  456.     cmRGB16Space                = cmWord5ColorPacking + cmRGBSpace,
  457.     cmRGB32Space                = cmLong8ColorPacking + cmRGBSpace,
  458.     cmARGB32Space                = cmLong8ColorPacking + cmAlphaFirstPacking + cmRGBASpace,
  459.     cmCMYK32Space                = cmLong8ColorPacking + cmCMYKSpace,
  460.     cmHSV32Space                = cmLong10ColorPacking + cmHSVSpace,
  461.     cmHLS32Space                = cmLong10ColorPacking + cmHLSSpace,
  462.     cmYXY32Space                = cmLong10ColorPacking + cmYXYSpace,
  463.     cmXYZ32Space                = cmLong10ColorPacking + cmXYZSpace,
  464.     cmLUV32Space                = cmLong10ColorPacking + cmLUVSpace,
  465.     cmLAB32Space                = cmLong10ColorPacking + cmLABSpace,
  466.     cmGamutResult1Space            = cmOneBitDirectPacking + cmGamutResultSpace,
  467.     cmRGB24Space                = cm24_8ColorPacking + cmRGBSpace,
  468.     cmRGBA32Space                = cm32_8ColorPacking + cmAlphaLastPacking + cmRGBASpace,
  469.     cmLAB24Space                = cm24_8ColorPacking + cmLABSpace,
  470.     cmNamedIndexed32Space        = cm32_32ColorPacking + cmNamedIndexedSpace,
  471.     cmMCFive8Space                = cm40_8ColorPacking + cmMCFiveSpace,
  472.     cmMCSix8Space                = cm48_8ColorPacking + cmMCSixSpace,
  473.     cmMCSeven8Space                = cm56_8ColorPacking + cmMCSevenSpace,
  474.     cmMCEight8Space                = cm64_8ColorPacking + cmMCEightSpace
  475. };
  476.  
  477.  
  478.  
  479. typedef unsigned long                     CMBitmapColorSpace;
  480.  
  481. struct CMBitmap {
  482.     char *                            image;
  483.     long                             width;
  484.     long                             height;
  485.     long                             rowBytes;
  486.     long                             pixelSize;
  487.     CMBitmapColorSpace                 space;
  488.     long                             user1;
  489.     long                             user2;
  490. };
  491. typedef struct CMBitmap                    CMBitmap;
  492.  
  493. /* Classic Print Manager Stuff */
  494.  
  495. enum {
  496.     enableColorMatchingOp        = 12,
  497.     registerProfileOp            = 13
  498. };
  499.  
  500.  
  501. enum {
  502.     cmNoProfileBase                = 0,
  503.     cmFileBasedProfile            = 1,
  504.     cmHandleBasedProfile        = 2,
  505.     cmPtrBasedProfile            = 3,
  506.     cmProcedureBasedProfile        = 4
  507. };
  508.  
  509.  
  510. struct CMFileLocation {
  511.     FSSpec                             spec;
  512. };
  513. typedef struct CMFileLocation            CMFileLocation;
  514.  
  515. struct CMHandleLocation {
  516.     Handle                             h;
  517. };
  518. typedef struct CMHandleLocation            CMHandleLocation;
  519.  
  520. struct CMPtrLocation {
  521.     Ptr                             p;
  522. };
  523. typedef struct CMPtrLocation            CMPtrLocation;
  524.  
  525. struct CMProcedureLocation {
  526.     CMProfileAccessUPP                 proc;
  527.     void *                            refCon;
  528. };
  529. typedef struct CMProcedureLocation        CMProcedureLocation;
  530.  
  531.  
  532. union CMProfLoc {
  533.     CMFileLocation                     fileLoc;
  534.     CMHandleLocation                 handleLoc;
  535.     CMPtrLocation                     ptrLoc;
  536.     CMProcedureLocation             procLoc;
  537. };
  538. typedef union CMProfLoc                    CMProfLoc;
  539.  
  540. struct CMProfileLocation {
  541.     short                             locType;
  542.     CMProfLoc                         u;
  543. };
  544. typedef struct CMProfileLocation        CMProfileLocation;
  545. /* Profile file and element access */
  546. EXTERN_API( CMError )
  547. CMNewProfile                    (CMProfileRef *            prof,
  548.                                  const CMProfileLocation * theProfile)                        FOURWORDINLINE(0x203C, 0x0008, 0x001B, 0xABEE);
  549.  
  550. EXTERN_API( CMError )
  551. CMOpenProfile                    (CMProfileRef *            prof,
  552.                                  const CMProfileLocation * theProfile)                        FOURWORDINLINE(0x203C, 0x0008, 0x001C, 0xABEE);
  553.  
  554. EXTERN_API( CMError )
  555. CMCloseProfile                    (CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x001D, 0xABEE);
  556.  
  557. EXTERN_API( CMError )
  558. CMUpdateProfile                    (CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x0034, 0xABEE);
  559.  
  560. EXTERN_API( CMError )
  561. CMCopyProfile                    (CMProfileRef *            targetProf,
  562.                                  const CMProfileLocation * targetLocation,
  563.                                  CMProfileRef             srcProf)                            FOURWORDINLINE(0x203C, 0x000C, 0x0025, 0xABEE);
  564.  
  565. EXTERN_API( CMError )
  566. CMValidateProfile                (CMProfileRef             prof,
  567.                                  Boolean *                valid,
  568.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x000C, 0x0026, 0xABEE);
  569.  
  570. EXTERN_API( CMError )
  571. CMGetProfileLocation            (CMProfileRef             prof,
  572.                                  CMProfileLocation *    theProfile)                            FOURWORDINLINE(0x203C, 0x0008, 0x003C, 0xABEE);
  573.  
  574. EXTERN_API( CMError )
  575. CMFlattenProfile                (CMProfileRef             prof,
  576.                                  unsigned long             flags,
  577.                                  CMFlattenUPP             proc,
  578.                                  void *                    refCon,
  579.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0014, 0x0031, 0xABEE);
  580.  
  581. EXTERN_API( CMError )
  582. CMUnflattenProfile                (FSSpec *                resultFileSpec,
  583.                                  CMFlattenUPP             proc,
  584.                                  void *                    refCon,
  585.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0010, 0x0032, 0xABEE);
  586.  
  587. EXTERN_API( CMError )
  588. CMGetProfileHeader                (CMProfileRef             prof,
  589.                                  CMAppleProfileHeader *    header)                                FOURWORDINLINE(0x203C, 0x0008, 0x0039, 0xABEE);
  590.  
  591. EXTERN_API( CMError )
  592. CMSetProfileHeader                (CMProfileRef             prof,
  593.                                  const CMAppleProfileHeader * header)                        FOURWORDINLINE(0x203C, 0x0008, 0x003A, 0xABEE);
  594.  
  595. EXTERN_API( CMError )
  596. CMProfileElementExists            (CMProfileRef             prof,
  597.                                  OSType                 tag,
  598.                                  Boolean *                found)                                FOURWORDINLINE(0x203C, 0x000C, 0x001E, 0xABEE);
  599.  
  600. EXTERN_API( CMError )
  601. CMCountProfileElements            (CMProfileRef             prof,
  602.                                  unsigned long *        elementCount)                        FOURWORDINLINE(0x203C, 0x0008, 0x001F, 0xABEE);
  603.  
  604. EXTERN_API( CMError )
  605. CMGetProfileElement                (CMProfileRef             prof,
  606.                                  OSType                 tag,
  607.                                  unsigned long *        elementSize,
  608.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0010, 0x0020, 0xABEE);
  609.  
  610. EXTERN_API( CMError )
  611. CMSetProfileElement                (CMProfileRef             prof,
  612.                                  OSType                 tag,
  613.                                  unsigned long             elementSize,
  614.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0010, 0x0023, 0xABEE);
  615.  
  616. EXTERN_API( CMError )
  617. CMSetProfileElementSize            (CMProfileRef             prof,
  618.                                  OSType                 tag,
  619.                                  unsigned long             elementSize)                        FOURWORDINLINE(0x203C, 0x000C, 0x0038, 0xABEE);
  620.  
  621. EXTERN_API( CMError )
  622. CMSetProfileElementReference    (CMProfileRef             prof,
  623.                                  OSType                 elementTag,
  624.                                  OSType                 referenceTag)                        FOURWORDINLINE(0x203C, 0x000C, 0x0035, 0xABEE);
  625.  
  626. EXTERN_API( CMError )
  627. CMGetPartialProfileElement        (CMProfileRef             prof,
  628.                                  OSType                 tag,
  629.                                  unsigned long             offset,
  630.                                  unsigned long *        byteCount,
  631.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0014, 0x0036, 0xABEE);
  632.  
  633. EXTERN_API( CMError )
  634. CMSetPartialProfileElement        (CMProfileRef             prof,
  635.                                  OSType                 tag,
  636.                                  unsigned long             offset,
  637.                                  unsigned long             byteCount,
  638.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0014, 0x0037, 0xABEE);
  639.  
  640. EXTERN_API( CMError )
  641. CMGetIndProfileElementInfo        (CMProfileRef             prof,
  642.                                  unsigned long             index,
  643.                                  OSType *                tag,
  644.                                  unsigned long *        elementSize,
  645.                                  Boolean *                refs)                                FOURWORDINLINE(0x203C, 0x0014, 0x0021, 0xABEE);
  646.  
  647. EXTERN_API( CMError )
  648. CMGetIndProfileElement            (CMProfileRef             prof,
  649.                                  unsigned long             index,
  650.                                  unsigned long *        elementSize,
  651.                                  void *                    elementData)                        FOURWORDINLINE(0x203C, 0x0010, 0x0022, 0xABEE);
  652.  
  653. EXTERN_API( CMError )
  654. CMRemoveProfileElement            (CMProfileRef             prof,
  655.                                  OSType                 tag)                                FOURWORDINLINE(0x203C, 0x0008, 0x0024, 0xABEE);
  656.  
  657. EXTERN_API( CMError )
  658. CMGetScriptProfileDescription    (CMProfileRef             prof,
  659.                                  Str255                 name,
  660.                                  ScriptCode *            code)                                FOURWORDINLINE(0x203C, 0x000C, 0x003E, 0xABEE);
  661.  
  662. EXTERN_API( CMError )
  663. CMCloneProfileRef                (CMProfileRef             prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x0042, 0xABEE);
  664.  
  665. EXTERN_API( CMError )
  666. CMGetProfileRefCount            (CMProfileRef             prof,
  667.                                  long *                    count)                                FOURWORDINLINE(0x203C, 0x0008, 0x0043, 0xABEE);
  668.  
  669. EXTERN_API( CMError )
  670. CMProfileModified                (CMProfileRef             prof,
  671.                                  Boolean *                modified)                            FOURWORDINLINE(0x203C, 0x0008, 0x0044, 0xABEE);
  672.  
  673.  
  674. /* named Color access functions */
  675. EXTERN_API( CMError )
  676. CMGetNamedColorInfo                (CMProfileRef             prof,
  677.                                  unsigned long *        deviceChannels,
  678.                                  OSType *                deviceColorSpace,
  679.                                  OSType *                PCSColorSpace,
  680.                                  unsigned long *        count,
  681.                                  StringPtr                 prefix,
  682.                                  StringPtr                 suffix)                                FOURWORDINLINE(0x203C, 0x001C, 0x0046, 0xABEE);
  683.  
  684. EXTERN_API( CMError )
  685. CMGetNamedColorValue            (CMProfileRef             prof,
  686.                                  StringPtr                 name,
  687.                                  CMColor *                deviceColor,
  688.                                  CMColor *                PCSColor)                            FOURWORDINLINE(0x203C, 0x0010, 0x0047, 0xABEE);
  689.  
  690. EXTERN_API( CMError )
  691. CMGetIndNamedColorValue            (CMProfileRef             prof,
  692.                                  unsigned long             index,
  693.                                  CMColor *                deviceColor,
  694.                                  CMColor *                PCSColor)                            FOURWORDINLINE(0x203C, 0x0010, 0x0048, 0xABEE);
  695.  
  696. EXTERN_API( CMError )
  697. CMGetNamedColorIndex            (CMProfileRef             prof,
  698.                                  StringPtr                 name,
  699.                                  unsigned long *        index)                                FOURWORDINLINE(0x203C, 0x000C, 0x0049, 0xABEE);
  700.  
  701. EXTERN_API( CMError )
  702. CMGetNamedColorName                (CMProfileRef             prof,
  703.                                  unsigned long             index,
  704.                                  StringPtr                 name)                                FOURWORDINLINE(0x203C, 0x000C, 0x004A, 0xABEE);
  705.  
  706.  
  707. /* Low-level matching functions */
  708. EXTERN_API( CMError )
  709. NCWNewColorWorld                (CMWorldRef *            cw,
  710.                                  CMProfileRef             src,
  711.                                  CMProfileRef             dst)                                FOURWORDINLINE(0x203C, 0x000C, 0x0014, 0xABEE);
  712.  
  713. EXTERN_API( CMError )
  714. CWConcatColorWorld                (CMWorldRef *            cw,
  715.                                  CMConcatProfileSet *    profileSet)                            FOURWORDINLINE(0x203C, 0x0008, 0x0015, 0xABEE);
  716.  
  717. EXTERN_API( CMError )
  718. CWNewLinkProfile                (CMProfileRef *            prof,
  719.                                  const CMProfileLocation * targetLocation,
  720.                                  CMConcatProfileSet *    profileSet)                            FOURWORDINLINE(0x203C, 0x000C, 0x0033, 0xABEE);
  721.  
  722. EXTERN_API( void )
  723. CWDisposeColorWorld                (CMWorldRef             cw)                                    FOURWORDINLINE(0x203C, 0x0004, 0x0001, 0xABEE);
  724.  
  725. EXTERN_API( CMError )
  726. CWMatchColors                    (CMWorldRef             cw,
  727.                                  CMColor *                myColors,
  728.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0002, 0xABEE);
  729.  
  730. EXTERN_API( CMError )
  731. CWCheckColors                    (CMWorldRef             cw,
  732.                                  CMColor *                myColors,
  733.                                  unsigned long             count,
  734.                                  long *                    result)                                FOURWORDINLINE(0x203C, 0x0010, 0x0003, 0xABEE);
  735.  
  736.  
  737. /* Bitmap matching */
  738. EXTERN_API( CMError )
  739. CWMatchBitmap                    (CMWorldRef             cw,
  740.                                  CMBitmap *                bitmap,
  741.                                  CMBitmapCallBackUPP     progressProc,
  742.                                  void *                    refCon,
  743.                                  CMBitmap *                matchedBitmap)                        FOURWORDINLINE(0x203C, 0x0010, 0x002C, 0xABEE);
  744.  
  745. EXTERN_API( CMError )
  746. CWCheckBitmap                    (CMWorldRef             cw,
  747.                                  const CMBitmap *        bitmap,
  748.                                  CMBitmapCallBackUPP     progressProc,
  749.                                  void *                    refCon,
  750.                                  CMBitmap *                resultBitmap)                        FOURWORDINLINE(0x203C, 0x0014, 0x002D, 0xABEE);
  751.  
  752.  
  753. /* Quickdraw-specific matching */
  754. EXTERN_API( CMError )
  755. CWMatchPixMap                    (CMWorldRef             cw,
  756.                                  PixMap *                myPixMap,
  757.                                  CMBitmapCallBackUPP     progressProc,
  758.                                  void *                    refCon)                                FOURWORDINLINE(0x203C, 0x0010, 0x0004, 0xABEE);
  759.  
  760. EXTERN_API( CMError )
  761. CWCheckPixMap                    (CMWorldRef             cw,
  762.                                  PixMap *                myPixMap,
  763.                                  CMBitmapCallBackUPP     progressProc,
  764.                                  void *                    refCon,
  765.                                  BitMap *                resultBitMap)                        FOURWORDINLINE(0x203C, 0x0014, 0x0007, 0xABEE);
  766.  
  767. EXTERN_API( CMError )
  768. NCMBeginMatching                (CMProfileRef             src,
  769.                                  CMProfileRef             dst,
  770.                                  CMMatchRef *            myRef)                                FOURWORDINLINE(0x203C, 0x000C, 0x0016, 0xABEE);
  771.  
  772. EXTERN_API( void )
  773. CMEndMatching                    (CMMatchRef             myRef)                                FOURWORDINLINE(0x203C, 0x0004, 0x000B, 0xABEE);
  774.  
  775. EXTERN_API( void )
  776. NCMDrawMatchedPicture            (PicHandle                 myPicture,
  777.                                  CMProfileRef             dst,
  778.                                  Rect *                    myRect)                                FOURWORDINLINE(0x203C, 0x000C, 0x0017, 0xABEE);
  779.  
  780. EXTERN_API( void )
  781. CMEnableMatchingComment            (Boolean                 enableIt)                            FOURWORDINLINE(0x203C, 0x0002, 0x000D, 0xABEE);
  782.  
  783. EXTERN_API( CMError )
  784. NCMUseProfileComment            (CMProfileRef             prof,
  785.                                  unsigned long             flags)                                FOURWORDINLINE(0x203C, 0x0008, 0x003B, 0xABEE);
  786.  
  787. EXTERN_API( CMError )
  788. CMCreateProfileIdentifier        (CMProfileRef             prof,
  789.                                  CMProfileIdentifierPtr  ident,
  790.                                  unsigned long *        size)                                FOURWORDINLINE(0x203C, 0x000C, 0x0041, 0xABEE);
  791.  
  792.  
  793. /* System Profile access */
  794. EXTERN_API( CMError )
  795. CMGetSystemProfile                (CMProfileRef *            prof)                                FOURWORDINLINE(0x203C, 0x0004, 0x0018, 0xABEE);
  796.  
  797. EXTERN_API( CMError )
  798. CMSetSystemProfile                (const FSSpec *            profileFileSpec)                    FOURWORDINLINE(0x203C, 0x0004, 0x0019, 0xABEE);
  799.  
  800.  
  801. /* External Profile Management */
  802. EXTERN_API( CMError )
  803. CMNewProfileSearch                (CMSearchRecord *        searchSpec,
  804.                                  void *                    refCon,
  805.                                  unsigned long *        count,
  806.                                  CMProfileSearchRef *    searchResult)                        FOURWORDINLINE(0x203C, 0x0010, 0x0027, 0xABEE);
  807.  
  808. EXTERN_API( CMError )
  809. CMUpdateProfileSearch            (CMProfileSearchRef     search,
  810.                                  void *                    refCon,
  811.                                  unsigned long *        count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0028, 0xABEE);
  812.  
  813. EXTERN_API( void )
  814. CMDisposeProfileSearch            (CMProfileSearchRef     search)                                FOURWORDINLINE(0x203C, 0x0004, 0x0029, 0xABEE);
  815.  
  816. EXTERN_API( CMError )
  817. CMSearchGetIndProfile            (CMProfileSearchRef     search,
  818.                                  unsigned long             index,
  819.                                  CMProfileRef *            prof)                                FOURWORDINLINE(0x203C, 0x000C, 0x002A, 0xABEE);
  820.  
  821. EXTERN_API( CMError )
  822. CMSearchGetIndProfileFileSpec    (CMProfileSearchRef     search,
  823.                                  unsigned long             index,
  824.                                  FSSpec *                profileFile)                        FOURWORDINLINE(0x203C, 0x000C, 0x002B, 0xABEE);
  825.  
  826. EXTERN_API( CMError )
  827. CMProfileIdentifierFolderSearch    (CMProfileIdentifierPtr  ident,
  828.                                  unsigned long *        matchedCount,
  829.                                  CMProfileSearchRef *    searchResult)                        FOURWORDINLINE(0x203C, 0x000C, 0x003F, 0xABEE);
  830.  
  831. EXTERN_API( CMError )
  832. CMProfileIdentifierListSearch    (CMProfileIdentifierPtr  ident,
  833.                                  CMProfileRef *            profileList,
  834.                                  unsigned long             listSize,
  835.                                  unsigned long *        matchedCount,
  836.                                  CMProfileRef *            matchedList)                        FOURWORDINLINE(0x203C, 0x0014, 0x0040, 0xABEE);
  837.  
  838.  
  839. /* Utilities */
  840. EXTERN_API( CMError )
  841. CMGetColorSyncFolderSpec        (short                     vRefNum,
  842.                                  Boolean                 createFolder,
  843.                                  short *                foundVRefNum,
  844.                                  long *                    foundDirID)                            FOURWORDINLINE(0x203C, 0x000C, 0x0011, 0xABEE);
  845.  
  846. EXTERN_API( CMError )
  847. CMGetCWInfo                        (CMWorldRef             cw,
  848.                                  CMCWInfoRecord *        info)                                FOURWORDINLINE(0x203C, 0x0008, 0x001A, 0xABEE);
  849.  
  850. EXTERN_API( CMError )
  851. CMConvertProfile2to1            (CMProfileRef             profv2,
  852.                                  CMProfileHandle *        profv1)                                FOURWORDINLINE(0x203C, 0x0008, 0x0045, 0xABEE);
  853.  
  854. /* ColorSpace conversion functions */
  855. EXTERN_API( CMError )
  856. CMConvertXYZToLab                (const CMColor *        src,
  857.                                  const CMXYZColor *        white,
  858.                                  CMColor *                dst,
  859.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004B, 0xABEE);
  860.  
  861. EXTERN_API( CMError )
  862. CMConvertLabToXYZ                (const CMColor *        src,
  863.                                  const CMXYZColor *        white,
  864.                                  CMColor *                dst,
  865.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004C, 0xABEE);
  866.  
  867. EXTERN_API( CMError )
  868. CMConvertXYZToLuv                (const CMColor *        src,
  869.                                  const CMXYZColor *        white,
  870.                                  CMColor *                dst,
  871.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004D, 0xABEE);
  872.  
  873. EXTERN_API( CMError )
  874. CMConvertLuvToXYZ                (const CMColor *        src,
  875.                                  const CMXYZColor *        white,
  876.                                  CMColor *                dst,
  877.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x0010, 0x004E, 0xABEE);
  878.  
  879. EXTERN_API( CMError )
  880. CMConvertXYZToYxy                (const CMColor *        src,
  881.                                  CMColor *                dst,
  882.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x004F, 0xABEE);
  883.  
  884. EXTERN_API( CMError )
  885. CMConvertYxyToXYZ                (const CMColor *        src,
  886.                                  CMColor *                dst,
  887.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0050, 0xABEE);
  888.  
  889. EXTERN_API( CMError )
  890. CMConvertRGBToHLS                (const CMColor *        src,
  891.                                  CMColor *                dst,
  892.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0051, 0xABEE);
  893.  
  894. EXTERN_API( CMError )
  895. CMConvertHLSToRGB                (const CMColor *        src,
  896.                                  CMColor *                dst,
  897.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0052, 0xABEE);
  898.  
  899. EXTERN_API( CMError )
  900. CMConvertRGBToHSV                (const CMColor *        src,
  901.                                  CMColor *                dst,
  902.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0053, 0xABEE);
  903.  
  904. EXTERN_API( CMError )
  905. CMConvertHSVToRGB                (const CMColor *        src,
  906.                                  CMColor *                dst,
  907.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0054, 0xABEE);
  908.  
  909. EXTERN_API( CMError )
  910. CMConvertRGBToGray                (const CMColor *        src,
  911.                                  CMColor *                dst,
  912.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0055, 0xABEE);
  913.  
  914. EXTERN_API( CMError )
  915. CMConvertXYZToFixedXYZ            (const CMXYZColor *        src,
  916.                                  CMFixedXYZColor *        dst,
  917.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0056, 0xABEE);
  918.  
  919. EXTERN_API( CMError )
  920. CMConvertFixedXYZToXYZ            (const CMFixedXYZColor * src,
  921.                                  CMXYZColor *            dst,
  922.                                  unsigned long             count)                                FOURWORDINLINE(0x203C, 0x000C, 0x0057, 0xABEE);
  923.  
  924. /* PS-related */
  925. EXTERN_API( CMError )
  926. CMGetPS2ColorSpace                (CMProfileRef             srcProf,
  927.                                  unsigned long             flags,
  928.                                  CMFlattenUPP             proc,
  929.                                  void *                    refCon,
  930.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0014, 0x002E, 0xABEE);
  931.  
  932. EXTERN_API( CMError )
  933. CMGetPS2ColorRenderingIntent    (CMProfileRef             srcProf,
  934.                                  unsigned long             flags,
  935.                                  CMFlattenUPP             proc,
  936.                                  void *                    refCon,
  937.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0014, 0x002F, 0xABEE);
  938.  
  939. EXTERN_API( CMError )
  940. CMGetPS2ColorRendering            (CMProfileRef             srcProf,
  941.                                  CMProfileRef             dstProf,
  942.                                  unsigned long             flags,
  943.                                  CMFlattenUPP             proc,
  944.                                  void *                    refCon,
  945.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0018, 0x0030, 0xABEE);
  946.  
  947. EXTERN_API( CMError )
  948. CMGetPS2ColorRenderingVMSize    (CMProfileRef             srcProf,
  949.                                  CMProfileRef             dstProf,
  950.                                  unsigned long *        vmSize,
  951.                                  Boolean *                preferredCMMnotfound)                FOURWORDINLINE(0x203C, 0x0010, 0x003D, 0xABEE);
  952.  
  953.  
  954. /* ColorSync 1.0 functions which have parallel 2.0 counterparts */
  955. EXTERN_API( CMError )
  956. CWNewColorWorld                    (CMWorldRef *            cw,
  957.                                  CMProfileHandle         src,
  958.                                  CMProfileHandle         dst)                                FOURWORDINLINE(0x203C, 0x000C, 0x0000, 0xABEE);
  959.  
  960. EXTERN_API( CMError )
  961. ConcatenateProfiles                (CMProfileHandle         thru,
  962.                                  CMProfileHandle         dst,
  963.                                  CMProfileHandle *        newDst)                                FOURWORDINLINE(0x203C, 0x000C, 0x000C, 0xABEE);
  964.  
  965. EXTERN_API( CMError )
  966. CMBeginMatching                    (CMProfileHandle         src,
  967.                                  CMProfileHandle         dst,
  968.                                  CMMatchRef *            myRef)                                FOURWORDINLINE(0x203C, 0x000C, 0x000A, 0xABEE);
  969.  
  970. EXTERN_API( void )
  971. CMDrawMatchedPicture            (PicHandle                 myPicture,
  972.                                  CMProfileHandle         dst,
  973.                                  Rect *                    myRect)                                FOURWORDINLINE(0x203C, 0x000C, 0x0009, 0xABEE);
  974.  
  975. EXTERN_API( CMError )
  976. CMUseProfileComment                (CMProfileHandle         profile)                            FOURWORDINLINE(0x203C, 0x0004, 0x0008, 0xABEE);
  977.  
  978. EXTERN_API( void )
  979. CMGetProfileName                (CMProfileHandle         myProfile,
  980.                                  CMIString *            IStringResult)                        FOURWORDINLINE(0x203C, 0x0008, 0x000E, 0xABEE);
  981.  
  982. EXTERN_API( long )
  983. CMGetProfileAdditionalDataOffset (CMProfileHandle         myProfile)                            FOURWORDINLINE(0x203C, 0x0004, 0x000F, 0xABEE);
  984.  
  985.  
  986. /* ProfileResponder functions */
  987. EXTERN_API( CMError )
  988. GetProfile                        (OSType                 deviceType,
  989.                                  long                     refNum,
  990.                                  CMProfileHandle         aProfile,
  991.                                  CMProfileHandle *        returnedProfile)                    FOURWORDINLINE(0x203C, 0x0010, 0x0005, 0xABEE);
  992.  
  993. EXTERN_API( CMError )
  994. SetProfile                        (OSType                 deviceType,
  995.                                  long                     refNum,
  996.                                  CMProfileHandle         newProfile)                            FOURWORDINLINE(0x203C, 0x000C, 0x0006, 0xABEE);
  997.  
  998. EXTERN_API( CMError )
  999. SetProfileDescription            (OSType                 deviceType,
  1000.                                  long                     refNum,
  1001.                                  long                     deviceData,
  1002.                                  CMProfileHandle         hProfile)                            FOURWORDINLINE(0x203C, 0x0010, 0x0010, 0xABEE);
  1003.  
  1004. EXTERN_API( CMError )
  1005. GetIndexedProfile                (OSType                 deviceType,
  1006.                                  long                     refNum,
  1007.                                  CMProfileSearchRecordHandle  search,
  1008.                                  CMProfileHandle *        returnProfile,
  1009.                                  long *                    index)                                FOURWORDINLINE(0x203C, 0x0014, 0x0012, 0xABEE);
  1010.  
  1011. EXTERN_API( CMError )
  1012. DeleteDeviceProfile                (OSType                 deviceType,
  1013.                                  long                     refNum,
  1014.                                  CMProfileHandle         deleteMe)                            FOURWORDINLINE(0x203C, 0x000C, 0x0013, 0xABEE);
  1015.  
  1016.  
  1017. #if OLDROUTINENAMES
  1018. /* constants */
  1019.  
  1020. typedef CMFlattenProcPtr                 CMFlattenProc;
  1021. typedef CMBitmapCallBackProcPtr         CMBitmapCallBackProc;
  1022. typedef CMProfileFilterProcPtr             CMProfileFilterProc;
  1023.  
  1024. enum {
  1025.     CMTrap                        = cmTrap,
  1026.     CMBeginProfile                = cmBeginProfile,
  1027.     CMEndProfile                = cmEndProfile,
  1028.     CMEnableMatching            = cmEnableMatching,
  1029.     CMDisableMatching            = cmDisableMatching
  1030. };
  1031.  
  1032. /* 1.0 Error codes, for compatibility with older applications. 1.0 CMM's may return obsolete error codes */
  1033.  
  1034. enum {
  1035.     CMNoError                    = 0,                            /*    obsolete name, use noErr */
  1036.     CMProfileError                = cmProfileError,
  1037.     CMMethodError                = cmMethodError,
  1038.     CMMemFullError                = -172,                            /*    obsolete, 2.0 uses memFullErr */
  1039.     CMUnimplementedError        = -173,                            /*    obsolete, 2.0 uses unimpErr */
  1040.     CMParamError                = -174,                            /*    obsolete, 2.0 uses paramErr */
  1041.     CMMethodNotFound            = cmMethodNotFound,
  1042.     CMProfileNotFound            = cmProfileNotFound,
  1043.     CMProfilesIdentical            = cmProfilesIdentical,
  1044.     CMCantConcatenateError        = cmCantConcatenateError,
  1045.     CMCantXYZ                    = cmCantXYZ,
  1046.     CMCantDeleteProfile            = cmCantDeleteProfile,
  1047.     CMUnsupportedDataType        = cmUnsupportedDataType,
  1048.     CMNoCurrentProfile            = cmNoCurrentProfile
  1049. };
  1050.  
  1051.  
  1052. enum {
  1053.     qdSystemDevice                = cmSystemDevice,
  1054.     qdGDevice                    = cmGDevice
  1055. };
  1056.  
  1057.  
  1058. enum {
  1059.     kMatchCMMType                = cmMatchCMMType,
  1060.     kMatchApplProfileVersion    = cmMatchApplProfileVersion,
  1061.     kMatchDataType                = cmMatchDataType,
  1062.     kMatchDeviceType            = cmMatchDeviceType,
  1063.     kMatchDeviceManufacturer    = cmMatchDeviceManufacturer,
  1064.     kMatchDeviceModel            = cmMatchDeviceModel,
  1065.     kMatchDeviceAttributes        = cmMatchDeviceAttributes,
  1066.     kMatchFlags                    = cmMatchFlags,
  1067.     kMatchOptions                = cmMatchOptions,
  1068.     kMatchWhite                    = cmMatchWhite,
  1069.     kMatchBlack                    = cmMatchBlack
  1070. };
  1071.  
  1072. /* types */
  1073. typedef CMCMYKColor                     CMYKColor;
  1074. typedef CMWorldRef                         CWorld;
  1075. typedef long *                            CMGamutResult;
  1076. /* functions */
  1077. #define EndMatching(myRef)                                                        CMEndMatching(myRef)
  1078. #define EnableMatching(enableIt)                                                CMEnableMatchingComment(enableIt)
  1079. #define GetColorSyncFolderSpec(vRefNum, createFolder, foundVRefNum, foundDirID)    CMGetColorSyncFolderSpec(vRefNum, createFolder, foundVRefNum, foundDirID)
  1080. #define BeginMatching(src, dst, myRef)                                            CMBeginMatching(src, dst, myRef)
  1081. #define DrawMatchedPicture(myPicture, dst, myRect)                                CMDrawMatchedPicture(myPicture, dst, myRect)
  1082. #define UseProfile(profile)                                                        CMUseProfileComment(profile)
  1083. #define GetProfileName(myProfile, IStringResult)                                CMGetProfileName(myProfile, IStringResult)
  1084. #define GetProfileAdditionalDataOffset(myProfile)                                CMGetProfileAdditionalDataOffset(myProfile)
  1085. #endif  /* OLDROUTINENAMES */
  1086.  
  1087.  
  1088. /* Deprecated stuff*/
  1089.  
  1090. /* PrGeneral parameter blocks */
  1091.  
  1092. struct TEnableColorMatchingBlk {
  1093.     short                             iOpCode;
  1094.     short                             iError;
  1095.     long                             lReserved;
  1096.     THPrint                         hPrint;
  1097.     Boolean                         fEnableIt;
  1098.     SInt8                             filler;
  1099. };
  1100. typedef struct TEnableColorMatchingBlk    TEnableColorMatchingBlk;
  1101.  
  1102. struct TRegisterProfileBlk {
  1103.     short                             iOpCode;
  1104.     short                             iError;
  1105.     long                             lReserved;
  1106.     THPrint                         hPrint;
  1107.     Boolean                         fRegisterIt;
  1108.     SInt8                             filler;
  1109. };
  1110. typedef struct TRegisterProfileBlk        TRegisterProfileBlk;
  1111.  
  1112. #if PRAGMA_STRUCT_ALIGN
  1113.     #pragma options align=reset
  1114. #elif PRAGMA_STRUCT_PACKPUSH
  1115.     #pragma pack(pop)
  1116. #elif PRAGMA_STRUCT_PACK
  1117.     #pragma pack()
  1118. #endif
  1119.  
  1120. #ifdef PRAGMA_IMPORT_OFF
  1121. #pragma import off
  1122. #elif PRAGMA_IMPORT
  1123. #pragma import reset
  1124. #endif
  1125.  
  1126. #ifdef __cplusplus
  1127. }
  1128. #endif
  1129.  
  1130. #endif /* __CMAPPLICATION__ */
  1131.  
  1132.